<!doctype html>
<html>
  
<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="./css/api.css" />
    <link rel="stylesheet" type="text/css" href="./css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./css/iconfont.css" />
    <style type="text/css">
        .iconfont {
            font-size: 1rem;
            color: #000;
        }

        .aui-btn.aui-pull-right.hidden,
        .hidden {
            display: none;
        }

        .aui-btn.aui-pull-right.isshowright,
        .isshowright {
            display: block;
        }

        .aui-btn.aui-pull-right.isshownoright,
        .isshownoright {
            display: none;
        }


        .news_mail_add {
            float: right;
        }

        .news_mail_add img {
            width: 1rem;
            margin: 0.7rem 0.5rem 0 0;
        }

        .aui-bar-nav {
            background: #fff;
        }

        .aui-bar-nav .aui-btn .aui-iconfont {
            color: #000;
        }

        .aui-bar-nav .aui-title {
            color: #000;
        }

        .aui-btn.aui-pull-right {
            color: #000;
            font-size: 0.65rem;
        }

        .aui-bar.aui-bar-nav.header.blueClass {
            background: #289FFF !important;
        }

        .aui-bar.aui-bar-nav.header.blueClass .aui-btn.aui-pull-left .aui-iconfont.aui-icon-left,
        .aui-bar.aui-bar-nav.header.blueClass .aui-title,
        .aui-bar.aui-bar-nav.header.blueClass .iconfont {
            color: #fff !important;
        }
    </style>
</head>

<body>
    <header class="aui-bar aui-bar-nav header" id="aui-header" :bgcolor=''>
        <a class="aui-btn aui-pull-left" tapmode onclick="closeWin()">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div id="frametitle" class="aui-title"></div>
        <a class="aui-btn aui-pull-right hidden" id="detaillist" tapmode onclick="do_open_detailist()">
            处理记录
        </a>
        <a class="aui-btn aui-pull-right hidden" id="right_search" style="color:#fff;font-size: 0.6rem;" tapmode
            onclick="do_open_search()">
            <i class="icon iconfont icon-search"></i>
        </a>
        <!-- <a class="aui-btn aui-pull-right hidden" id="right_edit" style="color:#fff;font-size: 0.6rem;" tapmode onclick="do_open_edit()">
            <i class="icon iconfont icon-bianji1"></i>
        </a> -->
        <a class="aui-btn aui-pull-right hidden" id="right_gatehistory" tapmode onclick="do_open_gatehistory()">
            <i class="icon iconfont icon-dingdan"></i>
        </a>
        <a class="aui-btn aui-pull-right hidden" id="right_qualitycontrol" tapmode onclick="do_open_qualityhistory()">
            <i class="icon iconfont icon-dingdan"></i>
        </a>
        <!-- 历史工单 -->
        <a class="aui-btn aui-pull-right hidden" id="right_neibubaoshiadd" tapmode onclick="do_open_neibubaoshi()">
            <i class="icon iconfont icon-11"></i>
        </a>
        <a class="aui-btn aui-pull-right hidden" id="right_service_jindu" tapmode onclick="do_open_service_jindu()">
            工单进度
        </a>
        <div class="aui-btn aui-pull-right hidden" v-on:click="open_mail()" id="right_book">
            <i class="icon iconfont icon-jia"></i>
        </div>
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_open_edit()" id="right_edit">
            <i class="icon iconfont icon-bianji"></i>
        </div>
        <!-- //筛选 -->
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_open_select()" id="right_select">
            <i class="icon iconfont icon-sandian"></i>
        </div>
        <!-- 整改工单操作按钮 -->
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_open_update()" id="right_update">
            <i class="icon iconfont icon-sandian"></i>
        </div>
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_open_add()" id="right_add">
            <i class="icon iconfont icon-addApp"></i>
        </div>
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_open_saoma()" id="right_saoma">
            <i class="icon iconfont icon-saoma"></i>
        </div>
        <!-- 工单协同、转移 -->
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_open_gongdan()" id="right_gongdan">
            <i class="icon iconfont icon-zhuanzeng"></i>
        </div>
        <!-- 考核项目转交 -->
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_open_quality()" id="right_qualityrenwu">
            <i class="icon iconfont icon-zhuanzeng"></i>
        </div>
        <!-- 品质检查任务转交 -->
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_open_control()" id="right_controlrenwu">
            <i class="icon iconfont icon-zhuanzeng"></i>
        </div>
        <!-- 装修任务转交 -->
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_renwu_zhuanjiao()" id="right_renwu">
            <i class="icon iconfont icon-zhuanzeng"></i>
        </div>
        <!-- 统计 -->
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_open_tongji()" id="right_tongji">
            <i class="icon iconfont icon-tongji1" style="font-size: 1.1rem;"></i>
        </div>
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_open_add_fee()" id="right_add_fee">
            <i class="icon iconfont icon-addApp"></i>
        </div>
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_open_fee_history()" id="right_view_fee_history">
            <i class="icon iconfont icon-dingdan"></i>
        </div>
         <!-- 内部通知新增 -->
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_add_neibu()" id="neibu_add">
            <i class="icon iconfont icon-addApp"></i>
        </div>
        <!-- 内部通知详情按钮-->
        <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_more_neibu()" id="neibu_more">
            <i class="icon iconfont icon-sandian"></i>
        </div>
         <!-- 订单列表右上角搜索按钮 -->
         <a class="aui-btn aui-pull-right hidden"  tapmode onclick="do_open_order_search()" id="right_order_search">
            <i class="icon iconfont icon-sousuo1" ></i>
        </a>
        <!-- 消息中心各类型消息清空按钮 -->
        <a class="aui-btn aui-pull-right hidden"  tapmode onclick="do_open_delete()" id="right_delete">
            <i class="icon iconfont icon-shanchu" ></i>
        </a>
         <!-- 在线离线模式切换按钮 -->
         <div class="aui-btn aui-pull-right hidden" tapmode onclick="do_change_line()" id="right_line">
            <i class="icon iconfont icon-fenlei"></i>
        </div>
        <!--是否隐藏右侧按钮-->
        <div id="hideFun" style="display:none;"></div>
    </header>
</body>
<script type="text/javascript" src="./script/api.js "></script>
<script type="text/javascript" src="./script/config.js"></script>
<script type="text/javascript" src="./script/common.js "></script>
<script type="text/javascript">
    window._onclose = null;
    var funkeyId = '';
    window.closeWin = function () {
        api.closeWin();
        //刷新首页-任务列表数量
        api.sendEvent({
            name:'home-refresh'
        })
    };
    window.do_open_search = function () {
        var searchtype = api.pageParam.searchtype || 0; //1-收费明细查询 2-工单明细查询
        api.sendEvent({
            name: 'do_open_search',
            extra: {
                searchtype: searchtype
            }
        });
    }
    window.do_open_detailist = function () {
        api.sendEvent({
            name: 'do_open_detailist'
        });
    }
    window.do_open_edit = function () {
        api.sendEvent({
            name: 'do_open_edit'
        });
    }
    window.do_open_select = function() {
        api.sendEvent({
            name: 'do_open_select'
        });
    }
    window.do_open_add = function () {
        api.sendEvent({
            name: 'do_open_add'
        });
    }
    window.do_open_saoma = function () {
        api.sendEvent({
            name: 'scandeviceqrcodedone'
        });
    }
    window.do_open_quality = function () {
        api.sendEvent({
            name: 'do_qualityzhuanjiao'
        });
    }
    
    window.do_open_tongji = function () {
        api.sendEvent({
            name: 'do_open_tongji'
        });
    }
    //工单详情-转交/协同
    window.do_open_gongdan = function () {
        api.sendEvent({
            name: 'do_open_chooseserviceuser'
        });
    }
     //装修任务转交
     window.do_renwu_zhuanjiao = function () {
        api.sendEvent({
            name: 'do_renwu_zhuanjiao'
        });
    }
    
    //整改任务操作按钮
    window.do_open_update = function () {
        api.sendEvent({
            name: 'do_renwu_update'
        });
    }
    window.do_open_gatehistory = function () {
        api.sendEvent({
            name: 'do_open_gatehistory'
        });
    }
    window.do_open_qualityhistory = function () {
        api.sendEvent({
            name: 'do_open_qualityhistory'
        });
    }
    //检查任务转交
    window.do_open_control = function () {
        api.sendEvent({
            name: 'do_open_controlreact'
        });
    }
    // 打开历史工单页面
    window.do_open_neibubaoshi = function () {
        api.sendEvent({
            name: 'do_open_neibubaoshi'
        });
    }
    window.do_open_service_jindu = function () {
        api.sendEvent({
            name: 'do_open_service_jindu'
        });
    }
    // window.do_open_add_fee = function () {
    //     api.sendEvent({
    //         name: 'do_open_add_fee'
    //     });
    // }
    window.do_open_fee_history = function(){
        api.sendEvent({
            name: 'do_open_fee_history'
        });
    }
    window.do_add_neibu = function () {
        api.sendEvent({
            name: 'do_add_neibu'
        });
    }
    window.do_more_neibu = function () {
        api.sendEvent({
            name: 'do_more_neibu'
        });
    }
    //订单搜索
    window.do_open_order_search = function() {
        api.sendEvent({
            name: 'do_open_order_search'
        });
    }
    //消息清空
    window.do_open_delete = function() {
        api.sendEvent({
            name: 'do_open_delete'
        });
    }
    //在线-离线模式切换
    window.do_change_line=function(){
        api.sendEvent({
            name: 'do_change_line'
        });
    }
    apiready = function () {
        var header = $api.byId('aui-header');
        $api.fixStatusBar(header);
        var headerH = $api.offset(header).h;
        var frameH = api.winHeight;
        var url = api.pageParam.url;
        var title = api.pageParam.title;
        var type = api.pageParam.type;
        var edit = api.pageParam.edit;
        //
        var bg = api.pageParam.bg;
        var txtcolor = api.pageParam.txtcolor;
        if (bg) {
            $api.addCls(header, 'blueClass');
        }

        if (url && url.length > 0 && url[0] != '.' && url[0] != '/' && url[0] != '\\') {
            if (url.indexOf('http://') < 0 && url.indexOf('https://') < 0) {
                url = url.replace('_win', '_frm');
                url = 'html/' + url;
            }
        }
        if (url.indexOf('scanner_frm') == -1) {
            api.sendEvent({
                name: 'do_close_scanner',
            });
        }
        if (url.indexOf('chooseproject_frm') == -1) {
            api.sendEvent({
                name: 'closechooseproject',
            });
        }
        // $api.css($api.byId('right_gongdan'), 'display:none;');

        if (url.indexOf('gate_sentry_frm') > -1) {
            $api.toggleCls($api.byId('right_gatehistory'), 'hidden');
        }
        if (url.indexOf('qualitycontrol_mainlist') > -1) {
            $api.toggleCls($api.byId('right_qualitycontrol'), 'hidden');
        }
        // if (url.indexOf('qualitycontrollist_frm') > -1) {
        //     $api.toggleCls($api.byId('right_qualitycontrol'), 'hidden');
        // }
        if (url.indexOf('qualitycontroldetail_frm') > -1) {
            $api.toggleCls($api.byId('right_update'), 'hidden');
        }
        // var IsChangeBt = api.pageParam.IsChangeBt;
        // api.addEventListener({
        //     name: 'update_IsChangeBt'
        // }, function (ret, err) {
        //     IsChangeBt = ret.value.IsChangeBt;
        // });           
        // if(IsChangeBt==true){
        //     if (url.indexOf('quality_checklist_frm') > -1) {
        //         $api.toggleCls($api.byId('right_qualityrenwu'), 'hidden');
        //     }
        // }else{
        //     if (url.indexOf('quality_checklist_frm') > -1) {
        //         $api.css($api.byId('right_qualityrenwu'), 'display:none;');
        //     }
        // }
        

        if (url.indexOf('customerservicelist_frm') > -1) {
            $api.toggleCls($api.byId('right_neibubaoshiadd'), 'hidden');
        }
        // if (url.indexOf('examine_typelist') > -1) {
        //     $api.toggleCls($api.byId('right_select'), 'hidden');
        // }
        // if (url.indexOf('equipment_typelist') > -1) {
        //     $api.toggleCls($api.byId('right_select'), 'hidden');
        // }
        if (url.indexOf('neibubaoshi_add_frm') > -1) {
            $api.toggleCls($api.byId('right_neibubaoshiadd'), 'hidden');
        }
        if (url.indexOf('purchase_add') > -1) {
            $api.toggleCls($api.byId('right_neibubaoshiadd'), 'hidden');
        }
        
        // if (url.indexOf('purchase_add') > -1) {
        //     $api.toggleCls($api.byId('right_neibubaoshiadd'), 'hidden');
        // }
        // if (url.indexOf('customerservicelist_frm') > -1) {
        //     $api.toggleCls($api.byId('right_service_jindu'), 'hidden');
        // }
        var searchtype = api.pageParam.searchtype || 0; //1-收费明细查询 2-工单明细查询
        if (searchtype > 0) {
            $api.toggleCls($api.byId('right_search'), 'hidden');
        }
        if (url.indexOf('home_news_mail_frm') > -1) {
            $api.toggleCls($api.byId('right_book'), 'hidden');
        }
        // if (url.indexOf('resources_detail_frm') > -1) {
        //     $api.toggleCls($api.byId('right_edit'), 'hidden');
        // }
        if (url.indexOf('guanjiaCar_frm') > -1) {
            $api.toggleCls($api.byId('right_edit'), 'hidden');
        }
        if (url.indexOf('equipment_frm') > -1) {
            $api.toggleCls($api.byId('right_add'), 'hidden');
        }
        if (url.indexOf('patrolplan_frm') > -1) {
            $api.toggleCls($api.byId('right_add'), 'hidden');
        }
        if (url.indexOf('patrolplan_frm') > -1) {
            $api.toggleCls($api.byId('right_view_fee_history'), 'hidden');
        }
        if(url.indexOf('analysis_patrolplan_frm') > -1){
            $api.toggleCls($api.byId('right_add'), 'hidden');
            $api.toggleCls($api.byId('right_view_fee_history'), 'hidden');         
        }
        if (url.indexOf('renwugongdan_addfee_frm') > -1) {
            $api.toggleCls($api.byId('right_view_fee_history'), 'hidden');
        }  
        if (url.indexOf('bjlh_frm') > -1) {
            $api.toggleCls($api.byId('right_add'), 'hidden');
        }
        if (url.indexOf('bjlh_frm') > -1) {
            $api.toggleCls($api.byId('right_view_fee_history'), 'hidden');
        }
        if (url.indexOf('outdoor_listfrm') > -1) {
            $api.toggleCls($api.byId('right_add'), 'hidden');
        }
        if (url.indexOf('analysis_equipment_frm') > -1) {
            $api.toggleCls($api.byId('right_add'), 'hidden');
        }
        if (url.indexOf('analysis_bjlh_frm') > -1) {
            $api.toggleCls($api.byId('right_add'), 'hidden');
            $api.toggleCls($api.byId('right_view_fee_history'), 'hidden');
        }
        // if (url.indexOf('analysis_historyfeelist_frm') > -1) {
        //     $api.toggleCls($api.byId('right_tongji'), 'hidden');
        // }
        if (url.indexOf('equipment_list_frm') > -1) {
            $api.toggleCls($api.byId('right_saoma'), 'hidden');
        }
        if (url.indexOf('equipment_list_frm_task') > -1) {
            $api.toggleCls($api.byId('right_saoma'), 'hidden');
        }
        if (url.indexOf('patrolplan_list_frm') > -1) {
            $api.toggleCls($api.byId('right_saoma'), 'hidden');
        }
        if (url.indexOf('patrolplan_list_frm_task') > -1) {
            $api.toggleCls($api.byId('right_saoma'), 'hidden');
        }
        if (url.indexOf('bjlh_list_frm') > -1) {
            $api.toggleCls($api.byId('right_saoma'), 'hidden');
        }
        if (url.indexOf('bjlh_list_frm_task') > -1) {
            $api.toggleCls($api.byId('right_saoma'), 'hidden');
        }
        if (url.indexOf('chargeroomfee_frm') > -1) {
            // $api.toggleCls($api.byId('right_add_fee'), 'hidden');
            $api.toggleCls($api.byId('right_view_fee_history'), 'hidden');
        }
        if (url.indexOf('distribution_center_frm') > -1) {
            $api.toggleCls($api.byId('right_qualitycontrol'), 'hidden');
        }
        if (url.indexOf('neibutz_list') > -1) {
            $api.toggleCls($api.byId('neibu_add'), 'hidden');
        }
        if (url.indexOf('neibutz_detail_frm') > -1) {
            $api.toggleCls($api.byId('neibu_more'), 'hidden');
        }
        if (url.indexOf('home_orderlist_frm') > -1) {
            $api.toggleCls($api.byId('right_order_search'), 'hidden');
        }
        if (url.indexOf('tongzhigonggao_typelist') > -1) {
            $api.toggleCls($api.byId('right_order_search'), 'hidden');
        }
        if (url.indexOf('tongzhigonggao_renwulist') > -1) {
            $api.toggleCls($api.byId('right_order_search'), 'hidden');
        }
        //安防巡更消息清空
        if (url.indexOf('patrolplan_typelist') > -1) {
            $api.toggleCls($api.byId('right_delete'), 'hidden');
        }
        //绿化保洁消息清空
        if (url.indexOf('bjlh_typelist') > -1) {
            $api.toggleCls($api.byId('right_delete'), 'hidden');
        }
        //设备巡检消息清空
        if (url.indexOf('equipment_typelist') > -1) {
            $api.toggleCls($api.byId('right_delete'), 'hidden');
        }
        //审批中心消息清空
        if (url.indexOf('examine_typelist') > -1) {
            $api.toggleCls($api.byId('right_delete'), 'hidden');
        }
        //客服工单消息清空
        if (url.indexOf('msgcustomerserviceList') > -1) {
            $api.toggleCls($api.byId('right_delete'), 'hidden');
        }
        //通知公告消息清空
        if (url.indexOf('tongzhigonggao_typelist') > -1) {
            $api.toggleCls($api.byId('right_delete'), 'hidden');
        }
        //内部通知消息清空
        // if (url.indexOf('neibutz_typelist') > -1) {
        //     $api.toggleCls($api.byId('right_delete'), 'hidden');
        // }

        //安防巡更代办-在线、离线模式切换
        if (url.indexOf('patrolplan_renwulist') > -1) {
            $api.toggleCls($api.byId('right_line'), 'hidden');
        }
         //安防巡更代办-离线、在线模式切换
        if (url.indexOf('renwulist_offlist') > -1) {
            $api.toggleCls($api.byId('right_line'), 'hidden');
        }

        var pageParam = {
            header_h: headerH,
        }
        Object.keys(api.pageParam).forEach(function (key) {
            if (key != 'title' && key != 'url') {
                pageParam[key] = api.pageParam[key];
            }
        });
        var ns = window.Foresight.Util;
        ns.openFrame('main', pageParam, {
            rect: {
                x: 0,
                y: headerH - 1,
                w: 'auto',
                h: frameH - headerH,
            },
            url: url
        });
        $api.dom(header, '#frametitle').innerText = title;
        if(url.indexOf('shoufeipay_success') > -1){
            api.addEventListener({
                name: 'keyback'
            }, function (ret, err) {
                if (ret) {
                    api.closeToWin({
                        name: 'shoufeiguanli_frm'
                    });
                }
            });
        }else{
            api.addEventListener({
                name: 'keyback'
            }, function (ret, err) {
                if (ret) {
                    window.closeWin();
                }
            });
        }
       

        if(url.indexOf('home_task_con_frm') > -1){
            api.addEventListener({
                name: 'is_hidden_right_gongdan'
            }, function (ret, err) {
                if (ret) {
                    funkeyId = ret.value.keyId;
                    $api.css($api.byId(ret.value.keyId), 'display:none;');
                    if (ret.value.IsHidden && url.indexOf('home_task_con_frm') > -1) {
                        $api.dom(header, '#hideFun').innerText = ret.value.IsHidden;
                        $api.css($api.byId(ret.value.keyId), 'display:block;');
                    }
                };
            });
        };

        if(url.indexOf('quality_checklist_frm') > -1){
            api.addEventListener({
                name: 'is_hidden_right_quality_checklist'
            }, function (ret, err) {
                if (ret) {
                    funkeyId = ret.value.keyId;
                    $api.css($api.byId(funkeyId), 'display:none;');
                    if (url.indexOf('quality_checklist_frm') > -1) {
                        let IsHidden = ret.value.IsHidden;
                        if(!IsHidden){
                            $api.css($api.byId(funkeyId), 'display:none;');
                        }
                        else{
                            $api.css($api.byId(ret.value.keyId), 'display:block;');
                        };
                    };
                };
            });
        };
        //品质检查显示隐藏右边转交按钮
        if(url.indexOf('qualityrenwulist_frm') > -1){
            api.addEventListener({
                name: 'is_hidden_right_control_list'
            }, function (ret, err) {
                if (ret) {
                    funkeyId = ret.value.keyId;
                    $api.css($api.byId(funkeyId), 'display:none;');
                    if (url.indexOf('qualityrenwulist_frm') > -1) {
                        let IsHidden = ret.value.IsHidden;
                        if(!IsHidden){
                            $api.css($api.byId(funkeyId), 'display:none;');
                        }
                        else{
                            $api.css($api.byId(ret.value.keyId), 'display:block;');
                        };
                    };
                };
            });
        };

        //装修巡查
        // if (url.indexOf('xcResult_frm') > -1) {
        //     $api.toggleCls($api.byId('right_renwu'), 'hidden');
        // }
        if(url.indexOf('xcResult_frm') > -1){
            api.addEventListener({
                name: 'is_hidden_right_xcResult'
            }, function (ret, err) {
                if (ret) {
                    funkeyId = ret.value.keyId;
                    $api.css($api.byId(funkeyId), 'display:none;');
                    if (url.indexOf('xcResult_frm') > -1) {
                        let IsHidden = ret.value.IsHidden;
                        if(IsHidden==3){
                            $api.css($api.byId(funkeyId), 'display:none;');
                        }
                        else{
                            $api.css($api.byId(ret.value.keyId), 'display:block;');
                        };
                    };
                };
            });
        };

    };
</script>

</html>